var t = getApp();

Page({
    data: {
        img: "",
        type: 1,
        code: ""
    },
    getMemberData: function() {
        var e = this, a = t.getNetAddresss("member.member.member-data");
        t._getNetWork({
            url: a,
            data: {
                v: 2,
                basic_info: 1
            },
            success: function(t) {
                var a = t.data;
                1 == a.result ? (e.setData({
                    code: a.data.member.inviteCode.code
                }), console.log(a.data.member.inviteCode.code)) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onLoad: function(t) {
        t.type && (1 == t.type ? wx.setNavigationBarTitle({
            title: "转证码"
        }) : (this.getMemberData(), wx.setNavigationBarTitle({
            title: "邀请码"
        })), this.setData({
            type: t.type
        })), this.getData();
    },
    getData: function() {
        var e = this, a = "";
        a = 1 == this.data.type ? "plugin.sign-buy.frontend.asset-transfer.wxa-code" : "member.member.invitation-code";
        var n = t.getNetAddresss(a);
        t._getNetWork({
            url: n,
            success: function(a) {
                if (0 == a.data.result) return t.tips(a.data.msg);
                e.setData({
                    img: a.data.data.qr_code_url
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});